|
![](/i/fill.gif) |
Arrrrghhh!! >_<
It so *nearly* works it's driving me insane... It *almost* works, but
it's still broken!
OK, can *anybody* figure out why the hell this doesn't work?
#include "transforms.inc"
#macro BuildPoly(Points, Faces, Radius)
union
{
// Wireframe / rounded edges
#local lp = 0;
#while(lp < dimension_size(Faces, 1))
#local A = Points[Faces[lp][0]];
#local LP = 1;
#while(LP<dimension_size(Faces, 2))
#local B = Points[Faces[lp][LP]];
sphere {A, Radius}
cylinder {A, B, Radius}
#local A = B;
#local LP = LP + 1;
#end
#local A = Points[Faces[lp][0]];
sphere {B, Radius}
cylinder {A, B, Radius}
#local lp = lp + 1;
#end
// Faces
#local lp = 0;
#while(lp < dimension_size(Faces, 1))
#local A = Points[Faces[lp][0]];
#local B = Points[Faces[lp][1]];
#local C = Points[Faces[lp][2]];
#local AB = B - A;
#local AC = C - A;
#local Axis0 = vnormalize(vcross(AB, AC));
#local Displ = vdot(Axis0, A);
#local Axis1 = vnormalize(AB);
#local Axis2 = vcross(Axis1, Axis0);
prism
{
linear_spline
linear_sweep
-Radius, +Radius, dimension_size(Faces, 2),
#local LP = 0;
#while(LP < dimension_size(Faces, 2))
#local P = Points[Faces[lp][LP]];
#local Q = <vdot(Axis1, P), vdot(Axis2, P)>;
Q
#local LP = LP + 1;
#end
translate +y*Displ
rotate 180*y
Point_At_Trans(Axis0)
}
#local lp = lp + 1;
#end
}
#end
#local CaseP = array[8]
{
<-2, -1, -1>, <-1, -1, +1>, <-1, +1, -1>, <-1, +1, +1>,
<+1, -1, -1>, <+1, -1, +1>, <+1, +1, -1>, <+1, +1, +1>
}
#local CaseF = array[6][4]
{
{0, 1, 3, 2},
{0, 4, 5, 1},
{0, 4, 6, 2},
{7, 6, 4, 5},
{7, 3, 2, 6},
{7, 3, 1, 5}
}
object
{
BuildPoly(CaseP, CaseF, 0.05)
rotate -40*y
texture {pigment {colour red 1}}
}
camera
{
location <0, +3, -3>
look_at 0
}
light_source {<0, +3, -3>, colour rgb 1}
Post a reply to this message
|
![](/i/fill.gif) |